package com.okami.controller;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author: TanJingyu
 * @create: 2021-03-20 16:29
 **/
@RestController
@RequestMapping("/csrf")
class CsrfController {

    @PostMapping
    private String csrf(HttpServletRequest request, @RequestBody String str) {
            System.out.println(request);
        System.out.println(str);
        return "'success..'";
    }

    public static class CsrfParam {
        private String username;

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        @Override
        public String toString() {
            return "CsrfParam{" +
                    "username='" + username + '\'' +
                    '}';
        }
    }
}
